home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Localization Tools / FMAT Editor / FMAT Editor 1.0.1 sources / Source / FMAT.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-08  |  1.9 KB  |  77 lines  |  [TEXT/KAHL]

  1. #ifndef __PACKAGES__
  2. #include <Packages.h>
  3. #endif
  4.  
  5. #include "ResEd.h"
  6.  
  7. /*
  8. File FMAT.h
  9. by Michael Hecht (Michael_Hecht@mac.sas.com)
  10. July 14, 1993
  11.  
  12. based on material
  13.     Copyright Apple Computer, Inc. 1985-1990
  14.     All rights reserved.
  15.  
  16.     Some modifications by Erik A. Johnson (johnsone@uxh.cso.uiuc.edu) for
  17.     THINK C (5.0.1).
  18. */
  19.  
  20. #define RESOURCE_TYPE        'FMAT'
  21. #define RESOURCE_STRING        "\pFormat"
  22.  
  23. #define ResID( n )            (ResEdID()*10 + (n))
  24.  
  25. void _PStrCopy( ConstStr255Param src, StringPtr dest );
  26. void _PStrCat( ConstStr255Param pend, StringPtr dest );
  27.  
  28. enum {
  29.     tokPEPlus = tokMaxSymbols + 1, tokPEMinus, tokPEMinusPlus,
  30.     kNumPaletteButtons
  31. };
  32.  
  33. enum {
  34.     kNumberPartsStringID = 1,
  35.     kLiteralStr = 1, kSignsStr, kDigitsStr, kThousandsStr, kDecPointStr,
  36.     kPercentStr, kEscapeStr, kSeparatorStr, kExponentsStr, kUnquotedStr,
  37.     kNumPaletteStaticText
  38. };
  39.  
  40. typedef struct {
  41.     FloatingWindowRec    fw;
  42.  
  43.     Rect                buttonList[ kNumPaletteButtons - 1 ];
  44.     Point                staticTextList[ kNumPaletteStaticText - 1 ];
  45. } NumberPartsPalette, **NumberPartsPaletteHandle;
  46.  
  47.  
  48. typedef NumFormatString FMATRec, *FMATPtr, **FMATHandle;
  49.  
  50. #define    sizeOfFMATResource    ((long)sizeof(FMATRec))
  51.  
  52. typedef struct {
  53.     ParentRec        w;
  54.  
  55.     NumberPartsPaletteHandle    thePalette;
  56.     NumberParts        partsTable;
  57.     NumFormatString    curFormat;
  58.     FormatStatus    curStatus;
  59.     TripleInt        curPositions;
  60.     Boolean            curPosValid;
  61.     Str255            originalFmtStr;
  62.     short            originalFmtScript;
  63.     TripleInt        originalPositions;
  64.     Str255            positiveExample, negativeExample, zeroExample;
  65.     
  66. } rFMATRec, *rFMATPtr, **rFMATHandle;
  67.  
  68.  
  69. void UpdateExamples( rFMATHandle myFMAT );
  70.  
  71. NumberPartsPaletteHandle NewNumberPartsPalette( rFMATHandle myFMAT );
  72. void InitNumberPartsPalette( NumberPartsPaletteHandle thePalette, NumberParts *parts,
  73.                             short parentFont );
  74. void UpdatePalette( NumberPartsPaletteHandle thePalette );
  75. void ClickPalette( EventRecord *evt, NumberPartsPaletteHandle thePalette );
  76. void CloseNumberPartsPalette( NumberPartsPaletteHandle thePalette );
  77.